<html>
<script type="text/javascript" src="<?=base_url()?>web/js/jquery.min.js"></script>
<script type="text/javascript" src="<?=base_url()?>web/js/jquery.cookie.js"></script>
<script type="text/javascript">

function attachXHR(){
	$('form._form-actions').submit(function(){
		var data  = $(this).serializeArray();
		var param = {};
		for( var i in data ){
			param[data[i].name] = data[i].value;
		}
		$.post( this.action , param, function(RT){
			$('#mainWrapper').html( RT );
			attachXHR();
		});
		
		return false;
	});
	
	$('._anchor-action').click(function(){
		if( $(this).hasClass( '_pagination') ){
			$.cookie('users._cf_ref', this.href ,{path: '/'});
		}
		$.get( this.href, {}, function(RT){
			$('#mainWrapper').html( RT );
			attachXHR();
		});
		
		return false;
	});
}
$(document).ready( function(){
	if( this.location.href.match(/\/list/) ){
		$.cookie('users._cf_ref', this.location.href, {path: '/'} );
	}
	attachXHR()
});

</script>

    <head>
        <title>
            <?php echo $cf_page_title; ?>
        </title>
    </head>
    <body>
        <div id="mainWrapper">
            
                <?php echo $cf_content ?>

        </div>
    </body>
</html>
